#{extends 'ApiDoc/base.html'/}

<script>
    $(function(){
        activeCate('.J-menu-cate-task');
    });
</script>

<link rel="stylesheet" type="text/css"
      href="#{href '/public/apidoc/layout/res_iframe.css'/}"/>

<link rel="stylesheet" href="#{href '/public/apidoc/view.css'/}">

<div class="page_doc">
    <div class="main_hd"><h2 id="title">任务列表</h2></div>
    <div class="main_bd">
        <div class="article_box">
            <div class="inner">

                <div class="gap"></div>

                <table class="table">
                    <thead>
                    <tr>
                        <th>任务</th>
                        <th>计划</th>
                        <th>执行次数</th>
                        <th>最后执行时间</th>
                        <th>执行时长</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    #{list items: taskList,as: 't'}
                    <tr>
                        <td>
                            ${t.getDisplayName()}
                        </td>
                        <td>
                            ${t.schedule}
                        </td>
                        <td>
                            ${t.executeCount} 次
                        </td>
                        <td>
                            #{ifnot t.lastExecuteTime}
                                -
                            #{/ifnot}
                            #{else}
                                ${new Date(t.lastExecuteTime).niceTime()}
                            #{/else}

                        </td>
                        <td>
                            #{ifnot t.lastExecuteDuration}
                                -
                            #{/ifnot}
                            #{else}
                                ${t.lastExecuteDuration.asDurationTime()}
                            #{/else}

                        </td>
                        <td>
                            <a href="@{viewTask(t.clazz.name)}">查看</a>
                            <a href="@{executeTask(t.clazz.name)}">马上执行</a>
                        </td>
                    </tr>
                    #{/list}
                    </tbody>
                </table>

            </div>
        </div>
    </div>

</div>